﻿using System;
using Glorysoft.EAP.Core.Enums;

namespace Glorysoft.EAP.Core.Entities
{
   public  class Shift
    {
        public  string Name { get; set; }
        public  DateTime time { get; set; }
        public static DateTime getShiftStartTime()
        {
            DateTime dayTime =  DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + (int)ShiftEnum.Day + ":00:00");
            DateTime nightTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + (int)ShiftEnum.Neight + ":00:00");
            DateTime currentTime = DateTime.Now;
            if (currentTime >= dayTime && currentTime < nightTime)
            {
                return dayTime;
            }
            else
            {
                return nightTime;
            }
            
        }
    }
}
